/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.ccut.titan.component.impl;

import edu.ccut.titan.component.IParameterInfo;

/**
 * {@link IParameterInfo} implementation
 * 
 * @see IParameterInfo
 * @author LeslieGu
 */
public class TitanParameterInfo implements IParameterInfo {

	private String id = "-1";

	private String name;

	private Class<?> classType;

	private String passingType;

	private String valueKey;

	private String description;

	private int scope;

	public TitanParameterInfo() {
	}

	public TitanParameterInfo(String id, String name, Class<?> classType,
			String passingType, String valueKey, String description, int scope) {
		this.id = id;
		this.name = name;
		this.classType = classType;
		this.passingType = passingType;
		this.valueKey = valueKey;
		this.description = description;
		this.scope = scope;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public Class<?> getClassType() {
		return classType;
	}

	public String getPassingType() {
		return passingType;
	}

	public String getDescription() {
		return description;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setClassType(Class<?> classType) {
		this.classType = classType;
	}

	public void setPassingType(String passingType) {
		this.passingType = passingType;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getValueKey() {
		return valueKey;
	}

	public void setValueKey(String valueKey) {
		this.valueKey = valueKey;
	}

	public int getScope() {
		return scope;
	}

	public void setScope(int scope) {
		this.scope = scope;
	}

	public int compareTo(IParameterInfo parameterInfo) {
		if (this.id != null) {
			return this.id.compareTo(parameterInfo.getId());
		}

		return -1;
	}

	public String toString() {
		return this.classType + "#" + this.name;
	}
}
